from pymysql import connect


def Link_database():
    """链接数据库"""
    # con = connect(host='rm-m5ev2j6ywo4m51ebu5o.mysql.rds.aliyuncs.com', user='root', passwd='112358Ys', db='djt',
    #               charset='utf8')
    # con = connect(host='193.112.133.62', user='ydsp', password='ydsp123456', db='djt', charset='utf8')
    con = connect(host='193.112.133.62', user='admin', password='admin888', db='admin', charset='utf8')

    obj = con.cursor()  # 游标对象
    return con, obj